﻿#region Usings

using System;
using System.ComponentModel.DataAnnotations;

#endregion

namespace RailNet.Dao.Entity
{
    [DisplayColumn("Id")]
    [Serializable]
    public class PriceDistance : IEquatable<PriceDistance>, IEntity
    {
        #region Primitive Properties

        [Key]
        public long Id { get; set; }

        [Required]
        public int TarifNumber { get; set; }

        [Required]
        [MaxLength(1)]
        public string Class { get; set; }

        [Required]
        public int ZoneFrom { get; set; }

        [Required]
        public int ZoneTo { get; set; }

        [Required]
        public decimal Price { get; set; }

        [Required]
        public DateTime ValidFrom { get; set; }

        [Required]
        public DateTime ValidTo { get; set; }

        #endregion

        #region Navigation Properties

        [Required]
        public virtual Ru Ru { get; set; }

        #endregion

        #region IEquatable members

        public bool Equals(PriceDistance other)
        {
            return Id == other.Id;
        }

        #endregion
    }
}